package com.naiterui.ehp.bs.pharmacist.entity;


import lombok.Data;

import javax.persistence.*;

import java.io.Serializable;
import java.util.Date;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 审核日志表
 */
@Data
@Table(name = "recom_audit_log")
@Entity
public class PharmacistRecomAuditLog implements Serializable {

    /**
     * 审核状态-待审核
     */
    public static final int AUDIT_STATUS_PENDING = 0;
    /**
     * 审核状态-通过
     */
    public static final int AUDIT_STATUS_PASS = 1;
    /**
     * 审核状态-不通过
     */
    public static final int AUDIT_STATUS_REJECT = 2;

    /**
     * 初审审核状态-待审核
     */
    public static final int PRE_AUDIT_STATUS_PENDING = 0;
    /**
     * 初审审核状态-通过
     */
    public static final int PRE_AUDIT_STATUS_PASS = 1;
    /**
     * 初审审核状态-不通过
     */
    public static final int PRE_AUDIT_STATUS_REJECT = 2;


    private static final long serialVersionUID = -1980125950103564669L;


    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = IDENTITY)
    @Column(name = "id", unique = true, nullable = false)
    private Long id;

    /**
     * 处方ID
     */
    @Column(name = "recom_id")
    private Long recomId;

    /**
     * 处方编号
     */
    @Column(name = "serial_number")
    private String serialNumber;

    /**
     * 医生ID
     */
    @Column(name = "doctor_id")
    private Long doctorId;

    /**
     * 医生姓名
     */
    @Column(name = "doctor_name")
    private String doctorName;

    /**
     * 患者ID
     */
    @Column(name = "patient_id")
    private Long patientId;

    /**
     * 患者姓名
     */
    @Column(name = "patient_name")
    private String patientName;

    /**
     * 审核状态(0:待审核,1:通过,2:不通过)
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 审核类型(1:系统,2:人工)
     */
    @Column(name = "audit_type")
    private Integer auditType;

    /**
     * 审核备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 初审状态（0:待审核, 1:通过, 2:不通过）
     */
    @Column(name = "pre_audit_status")
    private Integer preAuditStatus;

    /**
     * 初审药师ID
     */
    @Column(name = "pre_pharmacist_id")
    private Long prePharmacistId;

    /**
     * 初审药师姓名
     */
    @Column(name = "pre_pharmacist_name")
    private String prePharmacistName;

    /**
     * 初审时间
     */
    @Column(name = "pre_audit_time")
    private Date preAuditTime;

    /**
     * 审核药师ID
     */
    @Column(name = "pharmacist_id")
    private Long pharmacistId;

    /**
     * 审核药师姓名
     */
    @Column(name = "pharmacist_name")
    private String pharmacistName;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

    /**
     * 调配状态（0:待审核, 1:通过, 2:不通过）
     */
    @Column(name = "allocate_audit_status")
    private Integer allocateAuditStatus;

    /**
     * 调配药师ID
     */
    @Column(name = "allocate_pharmacist_id")
    private Long allocatePharmacistId;

    /**
     * 调配药师姓名
     */
    @Column(name = "allocate_pharmacist_name")
    private String allocatePharmacistName;

}
